import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:leader_help/utils/component/component.dart';
import 'package:native_pdf_view/native_pdf_view.dart';

import 'index.dart';
import 'widgets/widgets.dart';

class PdfViewPage extends GetView<PdfViewController> {
  const PdfViewPage({Key? key}) : super(key: key);

  // 内容页
  Widget _buildView() {
    final pdfController = PdfController(
      document: PdfDocument.openAsset('assets/pdf/xx.pdf'),
    );

    return PdfView(
      controller: pdfController,
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<PdfViewController>(
      builder: (_) {
        return Scaffold(
          appBar: detailAppBar(context, title: Get.arguments),
          body: SafeArea(
            child: _buildView(),
          ),
        );
      },
    );
  }
}
